import vue from 'vue';
import vueRouter from "vue-router";

vue.use(vueRouter);

// 添加路由时要带上：版块名称
// 一级路由
import login from'../components/login';//登录
import main from'../components/main';//主页
import forgetPwd from'../components/forgetPwd';//找回密码
// 二级路由
import message from'../components/message';//数据信息
import my_order from'../components/my_order';//我的订单
import recharge from'../components/recharge';//充值
import user_manage from'../components/user_manage';//用户管理
import order_manage from'../components/order_manage';//订单管理
import user_setting from'../components/user_setting';//个人设置
import contact from'../components/contact';//联系方式
import business_manage from'../components/business_manage';//业务管理
import pay from'../components/pay';//确认订单并支付

const route=[
	{
		path:"/login",
		component:login,
	},
	{
		path:"/forgetPwd",
		component:forgetPwd,
	},
	{
		path:"/main",
		component:main,
		children:[
			{path:"message",component:message},
			{path:"my_order",component:my_order},
			{path:"recharge",component:recharge},
			{path:"user_manage",component:user_manage},
			{path:"order_manage",component:order_manage},
			{path:"user_setting",component:user_setting},
			{path:"contact",component:contact},
			{path:"business_manage",component:business_manage},
			{path:"pay",component:pay},
			
			{path:"",redirect:"message"},//默认数据信息
		]
	},
	{path:"",redirect:"/login"},//默认登录页
]


const router = new vueRouter({
    routes : route
})
export default router;